import sympy
x = sympy.Symbol('x')
# 偏微分方程中的函数f(x)
f = sympy.Function('f')
# 要解的方程
F = sympy.diff(f(x), x, 2) - 2 * sympy.diff(f(x), x) - 3 * f(x)
# 求解
res = sympy.dsolve(F, f(x))
sympy.pprint(res)


